package com.wedistudio.slides.bo;

import java.util.Date;

public class Note implements Comparable<Note> {
	private String author;
	private Date date;
	private String note;
	private Integer slideNb;

	public Note() {
		super();
	}

	public Note(String author, Date date, int slideNb, String note) {
		super();
		this.author = author;
		this.date = date;
		this.slideNb = slideNb;
		this.note = note;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Integer getSlideNb() {
		return slideNb;
	}

	public void setSlideNb(Integer slideNb) {
		this.slideNb = slideNb;
	}

	@Override
	public int compareTo(Note another) {
		if (!author.equals(another.getAuthor()))
			return author.compareTo(another.getAuthor());

		if (!date.equals(another.getDate()))
			return date.compareTo(another.getDate());

		if (!note.equals(another.getNote()))
			return note.compareTo(another.getNote());

		return slideNb.compareTo(another.getSlideNb());

	}

}
